<?php

// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );


?>
<?php if($this->edit):?>

<form action="index.php" method="post" name="adminForm" id="adminForm">
<div style="width:100%;float:left;">
<fieldset class="adminform">
    
    <table class="admintable" width="100%">
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Ключевое слово' ); ?>
                </label>
            </td>
			<td valign="top">
					<input name="name" size="50" value="<?php echo $this->keywords->name;?>" />
            </td>
        </tr>
        <tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Metatitle' ); ?>
                </label>
            </td>
			<td valign="top">
					<input name="metatitle" size="50" value="<?php echo $this->keywords->metatitle;?>" />
            </td>
        </tr>
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Metakeys' ); ?>
                </label>
            </td>
			<td valign="top">
					<textarea name="metakey" cols=50 rows=10><?php echo $this->keywords->metakey;?></textarea>
            </td>
        </tr>
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Metadescr' ); ?>
                </label>
            </td>
			<td valign="top">
					<textarea name="metadescr" cols=50 rows=10><?php echo $this->keywords->metadescr;?></textarea>
            </td>
        </tr>
		
		
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Текст на странице 1' ); ?>
                </label>
            </td>
			<td valign="top">
					<?php echo $this->editor->display('descr1', $this->keywords->descr1, "500" , "300", '70', '15'); ?>
            </td>
        </tr>
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Текст на странице 2' ); ?>
                </label>
            </td>
			<td valign="top">
					<?php echo $this->editor->display('descr2', $this->keywords->descr2, "500" , "300", '70', '15'); ?>
            </td>
        </tr>
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                   <?php echo JText::_( 'Текст на странице 3' ); ?>
                </label>
            </td>
			<td valign="top">
					<?php echo $this->editor->display('descr3', $this->keywords->descr3, "500" , "300", '70', '15'); ?>
            </td>
        </tr>
		<tr >
            <td  align="left" class="key" style="text-align:left;">
                <label for="name">
                    <?php echo JText::_( 'Опубликовано ?' ); ?>
                </label>
            </td>
			<td valign="top">
				<select name="published">
					<option value="1" <?php if($this->keywords->published == 1) echo 'SELECTED';?>>Да</option>
					<option value="0" <?php if($this->keywords->published == 0) echo 'SELECTED';?>>Нет</option>
					
				</select>
            </td>
        </tr>
		
    </table>
</fieldset>

</div>
<input type="hidden" name="id" value="<?php echo $this->id?>" />
<input type="hidden" name="option" value="com_shop" />
<input type="hidden" name="task" value="" />


</form>

<?php else:?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
	<table class="adminlist">
	<thead>
		<tr>
			<th width="5">
				<?php echo JText::_( '№' ); ?>
			</th>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->orders ); ?>);" />
			</th>		
			<th width="">
				<?php echo JText::_( 'Слово' ); ?>
			</th>				
			<th width="150">
				<?php echo JText::_( 'Metatitle' ); ?>
			</th>
			
			<th width="150">
				<?php echo JText::_( 'Metakeys' ); ?>
			</th>
			<th width="150">
				<?php echo JText::_( 'Metadescr' ); ?>
			</th>
			<th width="100">
				<?php echo JText::_( 'Опубликовано' ); ?>
			</th>
		</tr>
	</thead>
	<?php
	$k = 0;
	for ($i=0, $n=count( $this->keywords ); $i < $n; $i++)	{
		$row = &$this->keywords[$i];
		$checked 	= JHTML::_('grid.id',   $i, $row->id );
		?>
		<tr class="<?php echo "row$k"; ?>">
			<td align="center">
				<?php echo $row->id; ?>
			</td>
			<td align="center">
				<?php echo $checked; ?>
			</td>
			<td>
				<a href="index.php?option=com_shop&view=keywords&id=<?php echo $row->id;?>"><?php echo $row->name;?></a>
			</td>
			<td>
				<?php echo $row->metatitle; ?>
			</td>
			<td>
				<?php echo $row->metakey;?>
			</td>
			<td>
				<?php echo $row->metadescr;?>
			</td>
			<td>
				<?php if($row->published == 1) echo '<span style="font-weight:bold;color:green">Да</span>'; else echo '<span style="font-weight:bold;color:red">Нет</span>';?>
			</td>
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
	</table>
</div>

<input type="hidden" name="option" value="com_shop" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />

</form>
<?php endif; ?>